package pers.cz.orm.db;

import org.junit.Test;
import pers.cz.orm.dao.CommonDbDaoImpl;
import pers.cz.orm.entity.ImsJsonSoap10;

import java.util.Date;

/**
 * @program: Jef-orm
 * @description: 测试插入
 * @author: Cheng Zhi
 * @create: 2023-09-02 15:27
 **/
public class Insert {

    /**
     * @author Chengzhi
     * @date 2023-09-02
     * @测试目的：
     * @预期结果:
     */
    @Test
    public void testSimpleInsert(){

        ImsJsonSoap10 imsJsonSoap10 = new ImsJsonSoap10();
        imsJsonSoap10.setBusiCode("8888");
        imsJsonSoap10.setJsonId("880261623612");
        imsJsonSoap10.setInputSoap("test");
        imsJsonSoap10.setSoDate(new Date());
        int insert = new CommonDbDaoImpl().insert(imsJsonSoap10);
        System.out.println(insert);
    }

    /**
     * @author Chengzhi
     * @date 2023-11-09
     * @测试目的：测试mysql数据库 replace into
     * @预期结果:
     */
    @Test
    public void testOverride(){
        ImsJsonSoap10 imsJsonSoap10 = new ImsJsonSoap10();
        imsJsonSoap10.setBusiCode("8888");
        imsJsonSoap10.setJsonId("880261623612");
        imsJsonSoap10.setInputSoap("test");
        imsJsonSoap10.setSoDate(new Date());
        new CommonDbDaoImpl().override(imsJsonSoap10);
    }
}
